/*
 * Copyright 2008 Carnegie Mellon University
 * Licensed under the Apache License, Version 2.0 (the "License"); 
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *  
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, 
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package edu.cmu.lti.sepia.infra.eval.model;

public class IRJudgmentResult {

  private IRJudgmentUnit unit;
  private int userId; // assessor's user id
  private String judgment; // aka relevance
  private String evidence; // aka reason
  private int time; // time (in seconds) for an assessor to submit judgment since opening a document  
  
  //Special fields
  private boolean evaluatedByOthers;
  
  /**
   * @param judgmentId
   * @param userId
   * @param judgment
   * @param evidence
   */
  public IRJudgmentResult(int judgmentId, int userId, String judgment, String evidence, int time) {
    this.unit = new IRJudgmentUnit(judgmentId, -1, null, null, 0D);
    this.userId = userId;
    this.judgment = judgment;
    this.evidence = evidence;
    this.time = time;
  }
  
  /**
   * @param judgmentId
   * @param userId
   * @param judgment
   * @param evidence
   */
  public IRJudgmentResult(IRJudgmentUnit unit, int userId, String judgment, String evidence, int time) {
    this.unit = unit;
    this.userId = userId;
    this.judgment = judgment;
    this.evidence = evidence;
    this.time = time;
  }
  
  /**
   * @return the judgmentId
   */
  public int getJudgmentId() {
    return unit.getJudgmentId();
  }
  /**
   * @param judgmentId the judgmentId to set
   */
  public void setJudgmentId(int judgmentId) {
    unit.setJudgmentId( judgmentId );
  }
  /**
   * @return the userId
   */
  public int getUserId() {
    return userId;
  }
  /**
   * @param userId the userId to set
   */
  public void setUserId(int userId) {
    this.userId = userId;
  }
  /**
   * @return the judgment
   */
  public String getJudgment() {
    return judgment;
  }
  /**
   * @param judgment the judgment to set
   */
  public void setJudgment(String judgment) {
    this.judgment = judgment;
  }
  /**
   * @return the evidence
   */
  public String getEvidence() {
    return evidence;
  }
  /**
   * @param evidence the evidence to set
   */
  public void setEvidence(String evidence) {
    this.evidence = evidence;
  }
  /**
   * @return the evidence
   */
  public String getTopicId() {
    return unit.getTopicId();
  }
  /**
   * @return the evidence
   */
  public String getDocId() {
    return unit.getDocumentId();
  }

  /**
   * @return the unit
   */
  public IRJudgmentUnit getUnit() {
    return unit;
  }

  /**
   * @param unit the unit to set
   */
  public void setUnit(IRJudgmentUnit unit) {
    this.unit = unit;
  }

  /**
   * @return the evaluatedByOthers
   */
  public boolean isEvaluatedByOthers() {
    return evaluatedByOthers;
  }

  /**
   * @param evaluatedByOthers the evaluatedByOthers to set
   */
  public void setEvaluatedByOthers(boolean evaluatedByOthers) {
    this.evaluatedByOthers = evaluatedByOthers;
  }

  /**
   * @return the time
   */
  public int getTime() {
    return time;
  }

  /**
   * @param time the time to set
   */
  public void setTime(int time) {
    this.time = time;
  }

}
